package com.bawei.module_inspection.fl.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bawei.module_inspection.fl.InspectionRecordFragment
import com.bawei.module_inspection.fl.InspectionStandardFragment
import com.bawei.module_inspection.fl.WorkOrderRecordFragment

class InspectionViewPageAdapter(
    fragmentManager: FragmentManager,
    lifecycle: Lifecycle
) : FragmentStateAdapter(fragmentManager,lifecycle) {
    override fun getItemCount(): Int {
        return 3
    }

    override fun createFragment(position: Int): Fragment {
        return when(position){
            0 -> InspectionStandardFragment()
            1 -> InspectionRecordFragment()
            2 -> WorkOrderRecordFragment()
            else -> throw IllegalArgumentException()
        }
    }


}